package com.rede.didiok.common.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.rede.didiok.common.config.feign.FeignConfiguration;
import com.rede.didiok.common.dto.pay.OrderAmountLogDto;
import com.rede.didiok.common.dto.pay.PayOrderDto;


/**
 * 支付服务feign远程调用
 *
 * @author 陌溪
 * @date 2023年4月25日22:24:31
 */

@FeignClient(name = "didiok-user", contextId = "didiok-pay1", configuration = FeignConfiguration.class)
public interface PayFeignClient {
    /**
     * 获取订单列表
     * @param payOrderVO
     * @return
     */
    @RequestMapping(value = "/pay/getPageList", method = RequestMethod.POST)
    String getPageList(@RequestBody PayOrderDto payOrderVO);


    /**
     * 校验是否完成支付
     * @param productUid：商品uid
     * @return
     */
    @RequestMapping(value = "/order/checkWhetherPay", method = RequestMethod.GET)
    String checkWhetherPay(@RequestParam("productUid") String productUid);

    /**
     * 获取订单数量
     * @param payOrderVO
     * @return
     */
    @RequestMapping(value = "/order/getPayOrderCount", method = RequestMethod.POST)
    String getPayOrderCount(@RequestBody PayOrderDto payOrderVO);

    /**
     * 获取订单累积金额
     * @param payOrderVO
     * @return
     */
    @RequestMapping(value = "/order/getPayOrderSumFee", method = RequestMethod.POST)
    String getPayOrderSumFee(@RequestBody PayOrderDto payOrderVO);

    /**
     * 天津爱订单记录
     * @param orderAmountLogVO
     * @return
     */
    @RequestMapping(value = "/orderAmountLog/add", method = RequestMethod.POST)
    String addOrderAmount(@RequestBody OrderAmountLogDto orderAmountLogVO);

    /**
     * 获取微信登录用户信息
     * @param code
     * @return
     */
    @RequestMapping(value = "/wechat/getWechatOauthInfo", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String getWechatOauthInfo(@RequestParam("code") String code);

    /**
     * 获取微信登录链接
     * @return
     */
    @RequestMapping(value = "/wechat/getWeChatLoginUrl", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String getWeChatLoginUrl(@RequestParam("code") String code);

    /**
     * 查询当前活动的报名人数
     * @return
     */
    @RequestMapping(value = "/pay/feign/order/getApplyUserNum", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String getApplyUserNumByResourceUid(@RequestParam("resourceUid") String resourceUid);

    /**
     * 将该活动对应的所有报名订单取消
     * @return
     */
    @RequestMapping(value = "/pay/feign/order/cancelByResourceUid", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String cancelPayOrderByResourceUid(@RequestParam("resourceUid") String resourceUid);
}